#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QListWidget>
#include <QTableWidget>
#include <QGroupBox>
#include <QPushButton>
#include <QLineEdit>
#include <QFile>
#include <QDataStream>
#include "child.h"
#include "qmqtt.h"
#include<QDebug>
#include "qqueue.h"
#include "qmap.h"
#include "qvector.h"
#include "jing.h"
#include "add.h"

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget();
    void addbasic();
    void jingbasic();
    QString get_last_wen(QString name);
    QString Name;
    int count=-1;
public slots:
    void flushtable();
    void addmess();
    void openchild();
    void deletebasic();
    void on_pb_connect_clicked();
    void doDataReceived(QMQTT::Message);//MQTT收到数据
    void Tablechange(int row);
private:
    QTableWidget *table;
    QPushButton *add;
    QPushButton *del;
    QPushButton *jing_diary;
    QPushButton *update;
    QVector<QPushButton*> xx;
    jing *baojing;
    Add *addjizhan;
    QMap<QString,child*> chi;
    QMap<QString,QQueue<QString>> jizhan;
    QMQTT::Client *client; //MQTT客户端指针
    QTableWidgetItem* item;
};
#endif // WIDGET_H
